﻿using OutlookManagerLibrary;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;

namespace TestSkypeComponents
{


	/// <summary>
	///This is a test class for OutlookManagerTest and is intended
	///to contain all OutlookManagerTest Unit Tests
	///</summary>
	[TestClass()]
	public class OutlookManagerTest
	{


		private TestContext testContextInstance;

		/// <summary>
		///Gets or sets the test context which provides
		///information about and functionality for the current test run.
		///</summary>
		public TestContext TestContext
		{
			get
			{
				return testContextInstance;
			}
			set
			{
				testContextInstance = value;
			}
		}

		#region Additional test attributes
		// 
		//You can use the following additional attributes as you write your tests:
		//
		//Use ClassInitialize to run code before running the first test in the class
		//[ClassInitialize()]
		//public static void MyClassInitialize(TestContext testContext)
		//{
		//}
		//
		//Use ClassCleanup to run code after all tests in a class have run
		//[ClassCleanup()]
		//public static void MyClassCleanup()
		//{
		//}
		//
		//Use TestInitialize to run code before running each test
		//[TestInitialize()]
		//public void MyTestInitialize()
		//{
		//}
		//
		//Use TestCleanup to run code after each test has run
		//[TestCleanup()]
		//public void MyTestCleanup()
		//{
		//}
		//
		#endregion


		/// <summary>
		///A test for GetMailList
		///</summary>
		[TestMethod()]
		public void GetMailListTest()
		{
			try
			{
				using (OutlookManager target = new OutlookManager())
				{
					List<OutlookMailInfo> expected = null;
					List<OutlookMailInfo> actual;
					actual = target.GetMailList();
					Assert.AreNotEqual(expected, actual);
				}
			}
			catch (System.Runtime.InteropServices.COMException ex) { System.Diagnostics.Debug.WriteLine(ex.Message); }
		}

		/// <summary>
		///A test for GetMailList
		///</summary>
		[TestMethod()]
		public void WcfTranslateTest()
		{
			using (ServiceReference1.TranslateServiceClient client = new ServiceReference1.TranslateServiceClient())
			{
				try
				{
					var responce = client.Translate(new ServiceReference1.TranslationRequest() { Content = "Hello my name is Alex", FromLanguage = "en", ToLanguage = "ru" });
					if (responce != null)
					{

					}
				}
				catch (System.ServiceModel.FaultException ex) { }

			}
		}
	}
}
